import Menu from "./menu"
import "./layout.css"
import { useRoutes } from "react-router-dom"
import Home from "./home"
import PostManage from "./postManage"
import Error from "./error"
import Header from "./header"
function Layout() {
  const routes = useRoutes([
    { path: "/home", element: <Home /> },
    { path: "/postManage", element: <PostManage /> },
    { path: "/*", element: <Error /> },
  ])
  return (
    <div className="container">
      <Header />
      <div className="layout">

        <div>
          {<Menu></Menu>}
        </div>
        <div style={{ width: '100%' }}>
          {routes}
        </div>
      </div>
    </div>
  );
}

export default Layout;
